<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>个人中心</title>
    <link href="../css/public.css" rel="stylesheet"/>
    <link href="../css/view.css" rel="stylesheet"/>
    <link href="../css/tipbox.css" rel="stylesheet" type="text/css"/>
    <!--foot-->
    <link href="../css/public_1.css" rel="stylesheet" media="all"/>
    <style></style>
    <script src="../js/vue2.5.17.js"></script>
    <script src="../js/kindeditor-all.js"></script>
    <script src="../js/lang/zh-CN.js"></script>
    <script type="text/javascript" src="../js/jquery1.7.js"></script>
    <!--<script src="../admin/layui/layui.all.js"></script>-->
    <script src="../../admin/layui/layui.js"></script>
    <link rel="stylesheet" href="../../admin/layui/css/layui.css">
</head>
<body>
<div>


    <div class="header_bg">
        <div class="header wap">
            <div class="logo"><a href="/index.html" title="权名众筹系统">权名众筹系统</a></div>
            <div class="nav cfff">
                <ul>
                    <li class="nav_a1"><a href="/index.html">首页</a></li>
                    <li class="nav_a2"><a href="/home/list.html?projectName=&page=1&limit=10&type=0">全部项目</a></li>
                    <li class="nav_a4"><a href="/home/apply.html">发布项目</a></li>                 <li class="nav_a5"><a href="/admin/index.html#/user/login">后台管理</a></li>


                </ul>
            </div>
            <div class="h_right">
                <ul class="h_login h_user displayNone"
                    v-bind:class="[userInfo.code===101 ? 'displayInlineBlock':'displayNone']" id="login_panel">
                <span>
                            <li class="hl_login"><a href="/home/login.html" class="h_login_ring">登录</a></li>
                            <li class="hl_reg"><a href="/home/sign.html" class="h_login_join">注册</a></li>
                            <li class="qq_login"><a href="#" title="QQ登陆">QQ登录</a></li>
                </span>
                    <li class="help_login"><a href="#">帮助</a></li>
                </ul>
                <ul class="h_login  h_reg displayNone"
                    v-bind:class="[userInfo.code===0 ? 'displayInlineBlock':'displayNone']" id="login_info">
                    <div>
                        <li class="h_name"><a href="/home/user/user.html">{{userInfo.data!=null
                            ?userInfo.data.username:''}}</a>
                            <div class="popup name_popup cfff displayNone">
                                <a href="/home/user/user.html">我的帐户</a>
                                <a href="/home/logout">安全退出</a>
                            </div>
                        </li>
                        <li class="h_message"><a href="#" id="notify">提醒</a>
                            <div class="popup message_popup cfff displayNone">
                                <a href="#" id="unread">未读通知 </a>
                                <a href="#" id="unreview">待评价项目 </a>
                                <a href="#" id="uncash">未兑现项目 </a>
                            </div>
                        </li>

                        <li class="help_login"><a href="#">帮助</a></li>
                    </div>
                </ul>
            </div>
            <div class="top_nav_ti" style="display: none;" id="tips_help">
                <span class="arrow"></span>
                <p>初来乍到？先看看帮助吧！</p>
                <a href="#" class="view_btn" id="close_help">知道啦</a>
            </div>
        </div>
    </div>


    <div class="content wap content_about" style="width: 1200px">


        <div class="bread_crumbs">
            <a href="/index.html">首页</a>
            > <a href="user.html">个人中心 </a> > <a href="mysupport.html">我的投资</a>
        </div>
        <div class="pro_main" style="width: 800px">
            <script type="text/html" id="table-projectName">
                <span>{{d.project.name}}</span>
            </script>
            <script type="text/html" id="table-projectDescription">
                <span>{{d.project.description}}</span>
            </script>
            <script type="text/html" id="table-status">
                <!--{{d.projectStatus}}-->
                {{#if(d.projectStatus===0){   }}
                <span class="layui-btn layui-btn-sm btn-danger">未回报</span>
                 {{# } }}
                {{#if(d.projectStatus===1){   }}
                <span class="layui-btn layui-btn-sm layui-btn-warm">回报中</span>
                {{# } }}
                {{#if(d.projectStatus===2){   }}
                <span class="layui-btn layui-btn-sm layui-btn-normal">完成</span>
                {{# } }}
            </script>

            <table class="layui-table" lay-data="{ url:'/home/getProjectSupportByHomeUser', page:true, id:'myProject'}"
                   lay-filter="myProject">
                <thead>
                <tr>
                    <th lay-data="{field:'supportId', width:50, sort: true}">ID</th>
                    <th lay-data="{field:'project', width:150, sort: true,templet: '#table-projectName'}">项目名称</th>
                    <th lay-data="{field:'project', width:236, sort: true,templet: '#table-projectDescription'}">项目简介</th>
                    <th lay-data="{field:'num', width:80, sort: true}">份数</th>
                    <th lay-data="{field:'price', width:100, sort: true}">单份价格</th>
                    <th lay-data="{field:'projectStatus', width:95, sort: true,templet:'#table-status'}">状态</th>


                    <!--<th lay-data="{fixed: 'right', width:80, align:'center', toolbar: '#barDemo'}"></th>-->
                </tr>
                </thead>
            </table>
            <script type="text/html" id="barDemo">
                <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
                <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>-->
                <!--<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>-->

            </script>

        </div>
        <div class="pro_right">
            <div class="pro_tit">
                <h1 class="f_yahei">当前用户</h1>
                <div class="pro_view f14">

                </div>
            </div>
            <div class="pro_author">

                <ul class="pro_author_list">
                    <li>
                        <a href="#" target="_blank">
                            <img id="user_c_img" :src="userInfo.data.userImg" width="50" height="50"
                                 :alt="userInfo.data.username"/>
                            {{userInfo.data.username}}
                        </a>
                    </li>
                </ul>
            </div>
            <div class="pro_state"></div>
            <div>
                <table class="layui-table" style="width: 30%;">
                    <colgroup>
                        <col width="40%">
                        <col>
                    </colgroup>
                    <tbody>
                    <tr>
                        <td><a href="user.html">个人中心</a></td>
                    </tr>
                    <tr>
                        <td><a href="updaterUser.html">修改信息</a></td>
                    </tr>
                    <tr>
                        <td><a href="repassword.html">修改密码</a></td>
                    </tr>
                    <tr>
                        <td><a href="myaddress.html">我的地址</a></td>
                    </tr>
                    <tr>
                        <td><a href="myproject.html">我的项目</a></td>
                    </tr>
                    <tr>
                        <td><a href="mysupport.html">我的投资</a></td>
                    </tr>
                    </tbody>
                </table>
            </div>


        </div>


    </div>

    <div class="footer">
        <div class="ft_link_bg">
            <div class="ft_link">
                <dl class="ft_about">
                    <a href="http://www.baidu.com" target="_blank" title="权名众筹基地">
                        <dt>众筹</dt>
                    </a>

                </dl>
                <dl class="ft_coop">
                    <dt>合作伙伴</dt>
                    <dd>


                    </dd>
                </dl>
                <dl class="ft_help">
                    <dt>帮助拓展</dt>

                </dl>
            </div>
        </div>
    </div>

    <div class="ws_global_footer">
        <div class="ws_footer_info" style="min-width: 1000px">
            <div class="content">
                <p>
                    <a href="#" target="_blank">桂ICP备123456789</a>　
                    权名众筹　
                    权名众筹　
                    权名众筹　
                    <a href="#"
                       target="_blank"
                       style="width:16px;height:16px;display:inline-block;background:url('../images/wen_icon.png')">&nbsp;</a>
                </p>
                <p>
                    Copyright (C) 2018 权名众筹 Rights Reserved　
                    　
                    　
                    <a href="#" target="_blank">百度</a>
                </p>
            </div>
        </div>
    </div>
</div>


<script>

    //获取头部
    $.ajax({
        url: "/home/getCurrentUser",
        async: true,
        success: function (data) {
            if (data.code == 101) {
                alert("请先登录");
                window.location.href = "/home/login.html";
            }
            new Vue({
                el: '.h_right,.pro_author',
                data: {userInfo: data}
            })
            new Vue({
                el: '.pro_author',
                data: {userInfo: data}
            })
            console.log(data)

        }
    });

    layui.use(['table'], function () {
        var table = layui.table
            , $ = layui.$
        ;
        //监听单元格编辑
        table.on('edit(myProject)', function (obj) {
            var value = obj.value //得到修改后的值
                , data = obj.data //得到所在行所有键值
                , field = obj.field; //得到字段
            layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改为：' + value);
        });

        //监听行工具事件
        table.on('tool(myProject)', function (obj) {
            var data = obj.data;
            //console.log(obj)
            if (obj.event === 'del') {
                layer.confirm('真的删除行么', function (index) {
                    obj.del();
                    layer.close(index);
                });
            } else if (obj.event === 'edit') {
                layer.prompt({
                    formType: 2
                    , value: data.name
                }, function (value, index) {
                    obj.update({
                        name: value
                    });
                    layer.close(index);
                });
            } else if (obj.event === 'detail') {
                layer.prompt({
                    formType: 2
                    , value: data.name
                }, function (value, index) {
                    obj.update({
                        name: value
                    });
                    layer.close(index);
                });
            }
        });

    });


</script>


</body>
</html>
